class FinalClassDemo
	{
	public static void main(String[] args)
		{
		B b = new B();
		b.showB();
		}
	}
class A
	{
	void show()
		{
		System.out.println("A is extended");
		}
	}
final class B extends A
	{
	void showB()
		{
		System.out.println("B is final");
		show();
		}
	}
class C extends B// creates an error:"cannot inherit from final B
	{
	}